<?php
define("_ROOT", "..");
include _ROOT . "/mainfile.php";

$iID = is_numeric($_GET["id"]) ? $_GET["id"]:"";
$sTag = $_POST["txtTags"];
$aTags = explode(",", $sTag);
echo $sTag;
$sql = "
		INSERT INTO {$tablepre}xna_tags (tags,newsid) 
		VALUES
		('" . $sTag . "'," . $iID . ")";
echo OK;
$rt = $PlusDB->execute($sql);
if ($iID > 0)
{
    $sql = "
		UPDATE $xnatags SET
		tags='" . $sTag . "'
		WHERE newsid=" . $iID . "";
    $rt = $PlusDB->execute($sql);
}
echo OK;
?>